Title Banner

Previous Book Contents Book Index Next

Inside Macintosh: QuickDraw GX Graphics /
Chapter 3 - Geometric Styles / About Geometric Styles


Shapes and Styles

In general, a shape object is an object with a group of properties that describe a geometry; a style object is an object with a group of properties that affect how QuickDraw GX interprets a shape's geometry during drawing.

Every QuickDraw GX shape object contains a reference to a style object. Figure 3-1 shows the properties of a style object. In this figure, the geometric properties--those that apply primarily to geometric shapes--are highlighted. These properties are discussed in this chapter. The other style properties are shown in gray. These include

Figure 3-1 Style object with geometric properties highlighted

As Figure 3-2 depicts, a single style object can be shared by multiple shape objects.

Figure 3-2 Shared style objects

A geometric shape and a typographic shape can reference the same style object. The geometric shape uses the geometric style properties, which are described in this chapter, while the typographic shape uses the typographic style properties, which are described in the chapter "Typographic Styles" in Inside Macintosh: QuickDraw GX Typography.

QuickDraw GX typically handles style sharing for you. The section "Default Style Objects" on page 3-12 and the section "Associating Styles With Shapes" on page 3-36 describe the default style sharing behavior implemented by QuickDraw GX and how you can override this behavior.

As with all QuickDraw GX objects, a style object has an owner count, which reflects the number of existing references to the style object. When a new reference to a style object is created, the owner count of the style object is incremented; when a reference to a style object goes away, the owner count of the style object is decremented. When a style object has an owner count of 0, QuickDraw GX can free the memory used by the style object.

References to style objects typically include those contained in shape objects and those contained in variables in your application. QuickDraw GX manages the owner counts corresponding to references in shape objects for you; you are responsible for managing the owner counts corresponding to variables in your application. The chapter "Introduction to QuickDraw GX Objects" in Inside Macintosh: QuickDraw GX Objects explains owner counts and owner count management in more detail.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996




Navigation graphic, see text links

Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help